<template>
  <div>
    <el-container>
      <el-main>
            <div>
              <h2>{{category}}</h2>
            </div>
            <div>
              <articleScrollPage v-bind:query="article"></articleScrollPage>
            </div>
        </el-main>
    </el-container>
  </div>
</template>


<script>

import articleScrollPage from "@/components/articleScrollPage";
import {getCategoryArticles} from "@/api/category";

export default {
  name: "articleCategoryPage",
  props:{
    //todo 接收传递的文章类别
    category:String
  },
  data(){
    return{
      article:{
        categoryId: null
      }
    }
  },
  components: {
    articleScrollPage
  },
 /* methods:{
    getCategoryArticles() {
      var id = this.$route.params.id
      // this.article.categoryId = id
      getCategoryArticles(id).then((res)=>{
        if(res.data.data){
          this.article = res.data.data;
        }else{
          this.$message("系统错误")
        }
      }).catch((err)=>{
        this.$message("系统错误")
      })
      this.article.categoryId = id
    }
  },*/
  created() {
    var id = this.$route.params.id
    this.article.categoryId = id
    // this.getCategoryArticles()
  }
}
</script>

<style scoped>

</style>
